package leetcodecompetition.S118;

import org.junit.jupiter.api.Test;
import tool.s;

import java.util.Arrays;

/**
 * @Author: Siantar
 * @Date: 2023-11-25-22:52
 * @Description: 1.0
 */
public class T100133 {
    public int minimumCoins(int[] prices) {
        int n = prices.length;
        int[] dp = new int[n + 1];
        Arrays.fill(dp, Integer.MAX_VALUE);
        dp[0] = 0;
        for (int i = 0; i < n; i++) {
            System.out.println(i);
            int sum=prices[i] + dp[i];
            for (int j = i + 1; j < Math.min(2 * i + 3, n + 1); j++) {
                dp[j] = Math.min(dp[j], sum);
            }
            s.print(dp);
        }
        return dp[n];
    }
    @Test
    public void test() {
        System.out.println(minimumCoins(new int[]{1,10,1,1}));
    }
}
